package com.boot.web.config;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 监控指标相关
 * @date 2023/3/28 21:15
 **/
@Configuration
public class MetricAutoConfiguration {

    @Bean
    public MeterRegistryCustomizer<MeterRegistry> registry(@Value("${spring.application.name}") String applicationName) {
        return registry -> registry.config().commonTags("application", applicationName);
    }

}
